body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background-color: #f4f6f8;
    color: #333;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background-color: #007bff;
    color: white;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e9ecef;
    transition: background-color 0.3s ease;
}

a.button {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

a.button.delete {
    background-color: #dc3545;
}

a.button.edit {
    background-color: #28a745;
}

a.button:hover {
    opacity: 0.9;
}

td.actions {
    white-space: nowrap;
}

@media (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background-color: #fff;
    }

    td {
        position: relative;
        padding-left: 50%;
        border: none;
        border-bottom: 1px solid #ddd;
        text-align: left;
    }

    td::before {
        position: absolute;
        top: 8px;
        left: 8px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #555;
    }
    /* 基础按钮样式 */
    .table-button {
        padding: 8px 16px;
        margin: 4px;
        border: none;
        border-radius: 5px;
        font-size: 14px;
        color: white;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.1s ease;
        display: inline-block;
    }



    td:nth-of-type(1)::before { content: "id"; }
    td:nth-of-type(2)::before { content: "姓名"; }
    td:nth-of-type(3)::before { content: "年龄"; }
    td:nth-of-type(4)::before { content: "性别"; }
    td:nth-of-type(5)::before { content: "操作"; }

    td.actions {
        padding-left: 15px;
    }

    td.actions::before {
        display: none;
    }

    a.button {
        display: block;
        margin: 4px 0;
    }
}
/* 删除按钮样式 */
.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-delete:active {
    transform: scale(0.98);
}

/* 编辑按钮样式（暂未实现） */
.btn-edit {
    background-color: #28a745;
}

.btn-edit:hover {
    background-color: #218838;
}

.btn-edit:active {
    transform: scale(0.98);
}

/* 按钮容器（用于控制间距） */
.button-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}
